global
  maxconn 2000
  ulimit-n 16384
  log 127.0.0.1 local0 err
  stats timeout 30s

defaults
  log global
  mode http
  option httplog
  timeout connect 5000
  timeout client 50000
  timeout server 50000
  timeout http-request 15s
  timeout http-keep-alive 15s


frontend monitor-in
  bind *:8888
  mode http
  option httplog
  monitor-uri /monitor

frontend apiserver
  bind 0.0.0.0:{{ k8s_cluster_entry_port }}
  bind 127.0.0.1:{{ k8s_cluster_entry_port }}
  mode tcp
  option tcplog
  tcp-request inspect-delay 5s
  default_backend apiserver


backend apiserver
  mode tcp
  option tcplog
  option tcp-check
  balance roundrobin
  default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
  {% for host in groups['master'] -%}
  server {{ hostvars[host]['node_name'] }} {{ hostvars[host].inventory_hostname }}:6443 check
  {% endfor %}

